package ind.nuts.lang.validate;

import ind.nuts.lang.enums.IEnum;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * @author haoyun.zheng
 */
@Documented
@Constraint(validatedBy = {EnumConstraintValidator.class})
@Target(FIELD)
@Retention(RUNTIME)
public @interface Enum {

    String message() default "枚举值为空";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

    Class<? extends IEnum> type();

    boolean required() default true;

}